<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-spring3-3.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org">
    <head th:include="staff/template :: header">
        <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
        <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
        <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
    </head>

    <body class="main-body">
        <div class="container main-container">
            <div th:substituteby="staff/template :: nav" />               
            <form class="form-horizontal" method="post" th:action="@{/staff/management/news/save}">
                <fieldset>
                    <div class="editor-container">
                        <!-- Form Name -->
                        <legend>Tạo bản tin</legend>

                        <!-- Text input-->
                        <label class="control-label" for="title">Tên bản tin</label>  
                        <input id="title" name="title" type="text" placeholder="" class="form-control input-md validate[required]"/>

                        <!--imageUrl-->
                        <label class="control-label" for="title">Ảnh đại diện</label>  
                        <input id="imageUrl" name="imageUrl" type="text" placeholder="" class="form-control input-md"/>


                        <!-- Select Multiple -->
                        <label class=" control-label" for="catalogs">Loại bản tin</label>
                        <select id="catalogs" name="catalogs" multiple="multiple" class=" my_select_box form-control" data-placeholder="Chọn loại bài viết..." >
                            <option th:value="${catalog.id}" th:text="${catalog.name}" th:each="catalog : ${listCatalogs}"></option>
                        </select>
                        <br/>

                        <!-- Textarea -->
                        <label class=" control-label" for="content">Nội dung</label>                 
                        <textarea id="content" name="content"/>
                        <!-- Button -->
                        <input type="submit" id="submit" name="submit" class="btn btn-primary space-top" text="Lưu lại"></input>
                        <button id="cancel" name="cancel" class="space-top btn btn-default">Thoát</button>
                    </div>
                </fieldset>
            </form>
            <div th:include="staff/template :: footer"></div>
        </div>	

        <script th:inline="javascript">
            /*<![CDATA[*/
            var url = /*[[@{/staff/management/news/catalog/add}]]*/ "url";
            jQuery(document).ready(function() {
                jQuery(".form-horizontal").validationEngine();
                COMMON.activeMenu("nav_website");
                $(".my_select_box").chosen({
                    disable_search_threshold: 10,
                    no_results_text: "Không tìm thấy kết quả",
                    width: "100%"
                });
                var config = {};
                var html = '';
                CKEDITOR.replace('content');
            });
            /*]]>*/
        </script>    
    </body>
</html>